<%@ page language="java" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <base href="<%=basePath%>"/>
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="cache-control" content="no-cache"/>
    <meta http-equiv="expires" content="0"/>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
    <meta http-equiv="description" content="This is my page"/>
    <title>添加主题--管理后台</title>
    <link href="../../../static/css/admin.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="../../../static/js/jquery-1.12.4.min.js"></script>

</head>
<body>
<div id="main">
    <%--  <%@ include file="console_element/left.html" %>--%>
    <div id="opt_area">
        <h1 id="opt_type"> 添加新闻： </h1>
        <form id="myform" enctype="multipart/form-data">
            <p>
                <label> 主题 </label>
                <select name="tid" id="mySelect">
                    <c:forEach items="${sessionScope.topic}" var="item">
                        <option name="tid"
                                value="${item.tid}" ${item.tid == sessionScope.detailNews.ntid?'selected':''}>${item.tname}</option>
                    </c:forEach>
                </select>
            </p>
            <p>
                <label> 标题 </label>
                <input name="ntitle" type="text" class="opt_input"/>
            </p>
            <p>
                <label> 作者 </label>
                <input name="nauthor" type="text" class="opt_input"/>
            </p>
            <p>
                <label> 摘要 </label>
                <textarea name="nsummary" cols="40" rows="3"></textarea>
            </p>
            <p>
                <label> 内容 </label>
                <textarea name="ncontent" cols="70" rows="10"></textarea>
            </p>
            <p>
                <label> 上传图片 </label>
                <input name="file" type="file" id="imageInput" class="opt_input"/>
                <div id="preview"></div>
            </p>
            <input type="button" onclick="saveNews()" value="提交" class="opt_sub"/>
            <input type="reset" onclick="resetForm()" value="重置" class="opt_sub"/>
        </form>
    </div>
</div>
<div id="footer">
    <%--  <%@ include file="console_element/bottom.html" %>--%>
</div>
</body>
</html>
